<?php

/**
 * This is the model class for table "v_goods_agentable".
 *
 * The followings are the available columns in table 'v_goods_agentable':
 * @property string $id ID
 * @property integer $gid Gid
 * @property string $provider_id 供应商id
 * @property string $dealer_id 经销商id
 * @property string $title Title
 * @property string $status Status
 * @property string $agent_status Agent Status
 * @property string $listing_status Listing Status
 * @property integer $related_id Related
 * @property string $dealer_listing_status Dealer Listing Status
 */
class VGoodsAgentable extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return VGoodsAgentable the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.VGoodsAgentableMetadata';
	}
	
	public function agent() {
		return GoodsAgentRelated::agent(
			$this->provider_id, $this->goods_id, $this->dealer_id
		);
	}
	
	public function deagent() {
		return GoodsAgentRelated::deagent(
			$this->provider_id, $this->goods_id, $this->dealer_id
		);
	}
}